/* Sample */

#include <stdlib.h>
#include <stdio.h>
#include <gtk/gtk.h>

#include "vlcsoundcontrol.h"

static void cb_sound_value_changed (VlcSoundControl *sound_control, gdouble value, gpointer user_data);
static void cb_destroy_window (GtkObject *object, gpointer user_data);

int
main (int argc, char *argv[])
{

  GtkWidget *window;
  GtkWidget *vbox;
  GtkWidget *sound_control;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  
  gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
  gtk_window_set_title (GTK_WINDOW (window), "Sample");

  vbox = gtk_vbox_new (FALSE, 0);

  gtk_container_add (GTK_CONTAINER (window), vbox);
  g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (cb_destroy_window), NULL);

  sound_control = vlc_sound_control_new();
  g_signal_connect (G_OBJECT (sound_control), "sound-value-changed", G_CALLBACK (cb_sound_value_changed), NULL);
  gtk_box_pack_start (GTK_BOX(vbox), sound_control, FALSE, FALSE, 0);

  gtk_widget_show_all (window);

  gtk_main ();

  return EXIT_SUCCESS;

}

static void
cb_sound_value_changed (VlcSoundControl *sound_control, gdouble value, gpointer user_data)
{

  printf ("Sound value is: %d\n", (int)value);
  (void)sound_control;
  (void)user_data;
  
}

static void
cb_destroy_window (GtkObject *object, gpointer user_data)
{

  gtk_main_quit ();
  (void)user_data;
  (void)object;

}
